#ifndef __THREAD_POOL__
#define __THREAD_POOL__
#include <iostream>
#include <vector>
#include <thread>
#include <mutex>
#include <memory>
#include <queue>
#include <functional>
#include <future>
#include <type_traits>
#include <condition_variable>
#include <atomic>

class ThreadPool{
private:
    std::mutex m_queue_mtx;
    std::vector<std::thread> m_worker_threads;
    std::condition_variable m_cv;
    std::atomic_bool m_stop;
    std::queue<std::function<void()>> m_queue;
public:
    explicit ThreadPool(size_t thread_num);

    ~ThreadPool();
    template<typename F,typename ...Args>
    auto enqueue(F&& f,Args&&... args) -> std::future<decltype(f(args...))>;

};


#endif